//
//  uiNodeLayer.hpp
//  smu_test1
//
//  Created by jiayi on 16/9/26.
//
//

#ifndef uiNodeLayer_hpp
#define uiNodeLayer_hpp

#include "cocos2d.h"
#include "ui/CocosGUI.h"
USING_NS_CC;

class uiNode;
class uiDoubleClickChecker;
class uiNodeLayer : public cocos2d::Layer
{
public:
    virtual ~uiNodeLayer();
    virtual bool init() override;
    
    CREATE_FUNC(uiNodeLayer);
    
public:
    // check every frame to build new node
    virtual void update( float ) override;
    void updateSize( uiNode* node );
    
protected:
    void _resetMaxSize();
    
    
protected:
    typedef queue< uiNode* > uiNodes;    
    uiNodes _nodes;
    cocos2d::Vec4 _maxSize; // minX, maxX, minY, maxY
    Node* _root;
};

#endif /* uiNodeLayer_hpp */
